home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
foss11b3.zip
/
DEVELOP
/
UTILCOLL
/
STATCONV.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-10-20
|
18KB
|
549 lines
{$M 32768,0,655360}
program StatConv;
uses
TParam, TFileIO,
Bits,
Types, ApiInt;
type
PStatConvert = ^TStatConvert;
TStatConvert = object
NodeNumber : Word;
StatType : ( Clean, PCB12, PCB14, MG );
constructor Init;
destructor Done;
procedure ReadParams;
procedure MakeFiles;
end;
BasArray = array[1.. 4] of byte;
Ascii2 = array[1.. 2] of char;
Ascii4 = array[1.. 4] of char;
Ascii5 = array[1.. 5] of char;
Ascii6 = array[1.. 6] of char;
Ascii8 = array[1.. 8] of char;
Ascii12 = array[1..12] of char;
Ascii13 = array[1..13] of char;
Ascii15 = array[1..15] of char;
Ascii18 = array[1..18] of char;
Ascii24 = array[1..24] of char;
Ascii25 = array[1..25] of char;
Ascii27 = array[1..27] of char;
Ascii30 = array[1..30] of char;
String80 = string[80];
FileNameType = string[80];
var
StatConvert : PStatConvert;
constructor TStatConvert.Init;
begin
dllInit( '', 0 );
end; { contructor Init }
destructor TStatConvert.Done;
begin
end; { destructor Done }
procedure TStatConvert.ReadParams;
begin
if Par^.SwAct['T'] then
if ( Par^.SwStr['T'] = 'PCB12' ) then StatType := PCB12
else if ( Par^.SwStr['T'] = 'PCB14' ) then StatType := PCB14
else if ( Par^.SwStr['T'] = 'MG' ) then StatType := MG
else StatType := PCB14
else StatType := PCB14;
if Par^.SwAct['C'] then StatType := Clean;
NodeNumber := S2I( Par^.Str[1] );
end; { procedure ReadParams }
procedure TStatConvert.MakeFiles;
var
SysCfg : SysCfgT;
NodeCfg : ModCfgT;
NStat : NodeStat;
User : LocUsers;
BBSDir : string;
FileDir : string;
Procedure MKS(PReal : Real; Var BReal : BasArray);
Var
X : Array[1..6] of byte absolute PReal;
begin { MKS }
{ Flip the exponent byte and try to pretend that X[2] & X[3] never existed }
Move(X[4],BReal[1],3);
BReal[4] := X[1];
end; { MKS }
Procedure WritePCB12;
type
PCB12FileType = record { 128 Bytes for PCBOARD version 12.1 }
Display : Ascii2; { Sysop's Display ON/OFF }
Printer : Ascii2; { Sysop's Printer ON/OFF }
PageBell : Ascii2; { Sysop's Page Bell ON/OFF }
CallAlarm: Ascii2; { Caller Alarm ON/OFF }
SysopNext: Ascii2; { Sysop "Next On" Flag }
BaudRate : Ascii4; { "CONNECT" Baud Rate of Caller }
Name : Ascii27; { Full Name of Caller (plus 2 spaces) }
FirstName: Ascii15; { First Name of Caller }
Graphics : Ascii2; { Graphics Mode of Caller }
Password : Ascii12; { Password of Caller }
RecordNum: Integer; { User's Database Record Number (MKI$)}
TimeLogOn: BasArray; { Time User Logged On (MKS$ seconds)}
TimeAllow: BasArray; { User's Allowed Time (MKS$ seconds)}
TimeDoor : BasArray; { Time Exited to Door (MKS$ seconds)}
LogONStattattr : Ascii5; { Time User Logged On (HH:MM)}
ConfExit : Ascii2; { Area Exited to DOS (not converted)}
ConfFlags: Ascii18; { Areas "Joined" Flags (not converted)}
ConfTime : Ascii2; { Area "Bonus" Time (not converted)}
ByteLmtDL: Ascii8; { Daily Download Limit (not converted)}
TimeCred : Integer; { Upload Time Bonus Earned (MKI$)}
Language : Ascii4; { Language Version Being Used }
ModemType: Ascii2; { Error Correcting Modem YES/NO }
NodeChat : Char; { Node Chat Status Flag }
end;
var
SS : string;
P12 : PCB12FileType;
P12F : file of PCB12FileType;
BR : BasArray;
begin
With P12 Do
begin
Display:='-1';
Printer:=' 0';
PageBell:=' 0';
CallAlarm:=' 0';
SysopNext:='N '; { 'N ', 'X ', ' '}
if (NStat.ConnectSpeed.ModemSpeed=0) then
BaudRate:='Loca'
Else
begin
SS:=Fill(I2S(NStat.ConnectSpeed.ModemSpeed,0),5,#32);
Move(SS[1],BaudRate,4);
end;
SS:=Fill(NStat.UserName,27,#32);
Move(SS[1],Name,27);
SS:=Fill(GetFirst(SS),15,#32);
Move(SS[1],FirstName,15);
if not (IBM In NStat.Graphics) then
Graphics:='7E'
Else if not (ANSI In NStat.Graphics) then
Graphics:=' 0'
Else
Graphics:='-1';
Password:=' ';
if (UpStr(NStat.UserName) = SysCfg.SysOpName) then
RecordNum:=1
Else
RecordNum:=2;
MKS(NStat.Connected,BR);
TimeLogOn:=BR;
MKS(NStat.TimeAllowed * 60,BR);
TimeAllow:=BR;
MKS(TimeNow,BR);
TimeDoor:=BR;
SS:=TimeStr(NStat.Connected);
Move(SS[1],LogONStattattr,5);
ConfExit:=' ';
ConfFlags:=' ';
ConfTime:=' ';
ByteLmtDL:='0 ';
TimeCred:=0;
Language:='. ';
Language[2] := User.Language;
{ if NStat.ConnectSpeed.MNP then
ModemType:='-1'
Else}
ModemType:=' 0';
NodeChat:='U';
end;
Assign(P12F,'TEMP\' + I2S( NStat.NodeNo, 3 ) + '\PCBOARD.'+I2S(NStat.NodeNo,0));
ReWrite(P12F);
Write(P12F,P12);
Close(P12F);
Writeln('PCBoard version 12.0 - PCBOARD.SYS file written');
end; { Procedure WritePCB12 }
Procedure WritePCB14;
type
PCB14FileType = record { 128 Bytes for PCBOARD version 14.0 }
Display : Ascii2; { Sysop's Display ON/OFF }
Printer : Ascii2; { Sysop's Printer ON/OFF }
PageBell : Ascii2; { Sysop's Page Bell ON/OFF }
CallAlarm: Ascii2; { Caller Alarm ON/OFF }
SysopNext: Char; { Sysop "Next On" Flag }
ModemType: Ascii2; { Error Correcting Modem YES/NO }
Graphics : Char; { Graphics Mode of Caller }
NodeChat : Char; { Available for Node Chat YES/NO }
BaudOpen : Ascii5; { Baud Rate to Open Modem at }
BaudRate : Ascii5; { "CONNECT" Baud Rate of Caller }
RecordNum: Integer; { User's Database Record Number (MKI$)}
FirstName: Ascii15; { First Name of Caller }
Password : Ascii12; { Password of Caller }
TimeLogOn: Integer; { Time User Logged On (MKI$ minutes)}
TimeUsed : Integer; { Time Used Today (MKI$ minutes)}
LogONStattattr : Ascii5; { Time User Logged On (HH:MM:SS)}
TimeLimit: Integer; { Daily Time Limit (MKI$ minutes)}
ByteLmtDL: Integer; { Daily Download Limit (MKI$ K-bytes)}
ConfExit : Char; { Conference (Area) User Exited From }
ConfFlags: Ascii5; { Areas User Has "Joined" Today }
ConfScan : Ascii5; { Areas User Has Scanned for New Mail }
ConfTime : Integer; { Area "Bonus" Time (MKI$ minutes)}
TimeCred : Integer; { Upload Time Credit (MKI$ minutes)}
Language : Ascii4; { Language Version Being Used }
Name : Ascii25; { Full Name of Caller (First & Last)}